<template>
  <div id="app">
    <router-view/>
    <div  class="bottom-item" v-if="false==logining">
      <div class="items">
        <img src="./assets/service.png"/>
        <router-link to="/" class="item">首页</router-link>
      </div>
      <div class="items">
        <img src="./assets/home.png"/>
        <router-link to="/about" class="item">工作人员入口</router-link>
      </div>

    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      logining: false,
      loginStatus: false,
      identity: 0
    }
  },
  async created() {
    this.username = window.sessionStorage.getItem('nickname');
    this.userid = window.sessionStorage.getItem('username'); //也就是电话号码
    this.password = window.sessionStorage.getItem('password')
    this.id = window.sessionStorage.getItem('id')
    if(this.userid==null) {
      this.loginStatus = false
    }else {
      const { data: res } = await this.$http.post('login', {
        username: this.userid,
        password: this.password,
        rememberMe: false,})
      if(0 != res.code) {
        this.username = '(请先登录)';
        this.userid = '*** **** ****'
        this.logoStatus = true
        /*this.$message({
          type: 'warning',
          message: '自动登录失败，请稍后重试',
        })*/
        return;
      }
      this.identity = res.data.role
      this.loginStatus = true
      // this.logoStatus = false;
    }
    /*console.log(this.$route.path)
    console.log(this.$route.path=="/login")
     this.logining = this.$route.path=="/login" ? true : false*/
  },
  methods:{

  }
}
</script>

<style>
*{
  margin:0;
  padding:0;
  border:0;
}
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}

/* bottom项目栏 */
.bottom-item{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 13vw;
  display: flex;
  justify-content: space-around;
  box-shadow: 0 0 .5rem .1rem  rgba(30,104,234,0.1);
  background-color: white;
}
.items{

  position: center;
  /*position: fixed;*/
  /*flex-direction: column;*/
  width: 30%;
}

.bottom-item img{
  display: block;
  margin-left: 43%;
  margin-top: 10%;
  width: 16px;
  /*height: 16px;*/
}
.item{
  margin: 0;
  padding: 0;
  font-family:  FZLTHJW--GB1-0;
  font-size: 0.8rem;
  color: #878787;
  text-decoration:none;
}
</style>
